﻿@*@using SCB.WHP.COMMON.WebControls
@using SCB.WHP.COMMON.Extensions
@using SellerCube.Entity.Enumerations
@using SellerCube.Api.Helper
@model SellerCube.Entity.BreakageItem*@
@{
    var MyLanguage = SellerCube.Api.Core.GlobalResources.MemberContext2.GetLanguageResource;
    ViewBag.Title = MyLanguage.GetValue("报损下架明细");
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
<div class="page-content">
    <div class="widget-box">
        <div class="widget-header widget-header-flat">
            <h4 class="blue"><b>@MyLanguage.GetValue("报损下架明细列表")</b></h4>
            <div class="widget-toolbar">
                <a href="#" data-action="collapse">
                    <i class="1 bigger-125 icon-chevron-up"></i>
                </a>
            </div>
            <div class="widget-toolbar no-border">
                <button id="btnToggleSearch" class="btn btn-sm btn-success">
                    <i class="icon-search bigger-110"></i>
                    @MyLanguage.GetValue("查找")
                </button>
                <button id="btnAdd" class="btn btn-sm btn-primary">
                    <i class="icon-plus bigger-110"></i>
                    <span class="bigger-110 no-text-shadow">@MyLanguage.GetValue("添加")</span>
                </button>
                <button id="btnEdit" class="btn btn-sm btn-primary">
                    <i class="icon-edit bigger-110"></i>
                    @MyLanguage.GetValue("修改")
                </button>
                <button id="btnDel" class="btn btn-sm btn-danger">
                    <i class="icon-trash"></i>
                    @MyLanguage.GetValue("删除")
                </button>
            </div>
        </div>

        <div class="widget-body">
            <div id="mainSearch" class="widget-main">
                <table class="table table-search table-bordered">
                    <tr>
                        <th>
                            @MyLanguage.GetValue("报损主键"):
                        </th>
                        <td>
                            <input type="text" cname="BreakageId" operate="eq" />
                        </td>
                        <th>
                            @MyLanguage.GetValue("货位库存主键"):
                        </th>
                        <td>
                            <input type="text" cname="ProductRackStockId" operate="eq" />
                        </td>
                        <th>
                            @MyLanguage.GetValue("产品主键"):
                        </th>
                        <td>
                            <input type="text" cname="ProductId" operate="eq" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            @MyLanguage.GetValue("产品属性主键"):
                        </th>
                        <td>
                            <input type="text" cname="PropertyId" operate="eq" />
                        </td>
                        <th>
                            @MyLanguage.GetValue("库存状态"):
                        </th>
                        <td>
                      @*   @Html.EnumDropDownListFor(m => m.StockStatus, "--", true, new { @cname = "StockStatus", @operate = "eq" })*@
                        </td>
                        <th>
                            @MyLanguage.GetValue("货架区域"):
                        </th>
                        <td>
                            <input type="text" cname="Area" operate="like" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            @MyLanguage.GetValue("货架排号"):
                        </th>
                        <td>
                            <input type="text" cname="Row" operate="like" />
                        </td>
                        <th>
                            @MyLanguage.GetValue("货架号"):
                        </th>
                        <td>
                            <input type="text" cname="Rack" operate="like" />
                        </td>
                        <th>
                            @MyLanguage.GetValue("货架位号"):
                        </th>
                        <td>
                            <input type="text" cname="Position" operate="like" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            @MyLanguage.GetValue("仓库主键"):
                        </th>
                        <td>
                            <input type="text" cname="StorageId" operate="eq" />
                        </td>
                        <th>
                            @MyLanguage.GetValue("SKU编号"):
                        </th>
                        <td>
                            <input type="text" cname="ProductCode" operate="like" />
                        </td>
                        <th>
                            @MyLanguage.GetValue("POA编号"):
                        </th>
                        <td>
                            <input type="text" cname="PropertyCode" operate="like" />
                        </td>
                    </tr>
                    <tr>
                        <th>
                            @MyLanguage.GetValue("报损数量"):
                        </th>
                        <td>
                            <input type="text" cname="Quantity" operate="eq" />
                        </td>
                        <th>
                            @MyLanguage.GetValue("完成上架数量(必须小于或等于报损数量)"):
                        </th>
                        <td>
                            <input type="text" cname="CompleteRackingQuantity" operate="eq" />
                        </td>
                        <th>
                            @MyLanguage.GetValue("下架状态"):
                        </th>
                        <td>
                        @* @Html.EnumDropDownListFor(m => m.BreakageItemStatus, "--", true, new { @cname = "BreakageItemStatus", @operate = "eq" })*@
                        </td>
                    </tr>
                    <tr>
                        <th>
                            @MyLanguage.GetValue("操作人主键"):
                        </th>
                        <td>
                            <input type="text" cname="OperatorId" operate="eq" />
                        </td>
                        <th>
                            @MyLanguage.GetValue("创建时间"):
                        </th>
                        <td colspan="3">
                            <span class="input-icon input-icon-right">
                                <input type="text" id="tbxStartCreatedDate" placeholder='@MyLanguage.GetValue("起")' class="ctlDatetime" cname="CreatedDate" operate="GreatEq"
                                       onfocus="WdatePicker({dateFmt:'yyyy-M-d H:mm',maxDate:'#F{$dp.$D(\'tbxEndCreatedDate\')}'})" />
                                <i class="icon-calendar green"></i>
                            </span>
                            <span class="input-icon input-icon-right">
                                <input type="text" id="tbxEndCreatedDate" placeholder='@MyLanguage.GetValue("止")' class="ctlDatetime" cname="CreatedDate" operate="LessEq"
                                       onfocus="WdatePicker({dateFmt:'yyyy-M-d H:mm',minDate:'#F{$dp.$D(\'tbxStartCreatedDate\')}'})" />
                                <i class="icon-calendar green"></i>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">
                            <div class="text-center">
                                <button type="button" class="btn btn-info btn-sm" onclick="mainGrid.search();">
                                    @MyLanguage.GetValue("搜索")
                                    <i class="icon-search icon-on-right"></i>
                                </button>
                                <button type="button" class="btn btn-sm" onclick="$('#mainSearch').clearForm();">
                                    @MyLanguage.GetValue("清空")
                                    <i class="icon-undo"></i>
                                </button>
                                <button type="button" class="btn btn-sm" onclick="$('#mainSearch').hide();">
                                    @MyLanguage.GetValue("隐藏")
                                    <i class="icon-arrow-left"></i>
                                </button>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="widget-main">
                <table id="mainTable" class="table table-striped table-bordered table-hover table-condensed">
                    <thead>
                        <tr>
                            <th class="center">
                                <label>
                                    <input id="cbxAllMain" type="checkbox" class="ace" />
                                    <span class="lbl"></span>
                                </label>
                            </th>
                            <th class="center">@MyLanguage.GetValue("产品条码")</th>
                            <th class="center">@MyLanguage.GetValue("属性条码")</th>
                            <th class="center">@MyLanguage.GetValue("库存状态")</th>
                            <th class="center">@MyLanguage.GetValue("货架")</th>
                            <th class="center">@MyLanguage.GetValue("仓库")</th>
                            <th class="center">@MyLanguage.GetValue("报损数量")</th>
                            <th class="center">@MyLanguage.GetValue("完成上架数量")</th>
                            <th class="center">@MyLanguage.GetValue("下架状态")</th>
                            <th class="center">@MyLanguage.GetValue("操作人主键")</th>
                            <th class="center">@MyLanguage.GetValue("创建时间")</th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</div>

@section FooterScripts{
    <script type="text/javascript">

    @*var enumStockStatus = @MvcHtmlString.Create(EnumExt.GetEnumJsObject<StockStatus>());
    var enumBreakageItemStatus = @MvcHtmlString.Create(EnumExt.GetEnumJsObject<BreakageItemStatus>());*@

    //grid对象
    var mainGrid = new $.createGrid({
        sAjaxSource: '@Url.Action("Index", "BreakageItem")',
        aaSorting: [[0, "desc"]],
        bDelayLoad: false,
        aoColumns: [
            { mData: "BreakageItemId", bSortable: false, sClass: 'center', sWidth: "50px",
                mRender: function (data, type, full) {
                    return "<label><input type='checkbox' class='ace'  value='" + data + "' /><span class='lbl'></span></label>";
                }
            },
            { mData: "BreakageId", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "ProductRackStockId", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "ProductId", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "PropertyId", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "StockStatus", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true,
                mRender: function (data, type, full) {
                    return enumStockStatus[data];
                }
            },
            { mData: "Area", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "Row", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "Rack", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "Position", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "StorageId", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "ProductCode", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "PropertyCode", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "Quantity", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "CompleteRackingQuantity", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "BreakageItemStatus", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true,
                mRender: function (data, type, full) {
                    return enumBreakageItemStatus[data];
                }
            },
            { mData: "OperatorId", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true },
            { mData: "CreatedDate", bSortable: false, bVisible: true, sWidth: "160px", bAutoWidth: true }
        ]
    });

    $('#btnToggleSearch').click(function(){
         $('#mainSearch').toggle();
    });

    $('#btnAdd').click(function(){
        mainGrid.add({
            title: '@MyLanguage.GetValue("报损下架明细 - 添加")',
             area: ['800px', 500],
             iframe: {
                src : '@Url.Action("Edit", "BreakageItem")'
            }
        });
    });

    $('#btnEdit').click(function(){
        mainGrid.edit(true, {
            title: '@MyLanguage.GetValue("报损下架明细 - 编辑")',
             area: ['800px', 500],
             iframe: {
                src : '@Url.Action("Edit", "BreakageItem")'
            }
        });
    });
    $('#btnDel').click(function(){
        mainGrid.del('@Url.Action("Delete", "BreakageItem")');
    });
    </script>
}
